package com.yilin.tms.core.entity.user.hatch;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author liuxu :)
 * @version 1.0
 * @date 2022-9-2
 */
@Entity
@Table(name = "hatch_plat_process")
@TableName("hatch_plat_process")
public class HatchProcess extends BaseEntity {
    public enum ProcessStatus {
        hatchApply(0, "产品申请已提交","已提交产品申请,等待创建网货账户"),
        serverApply(1, "正在申请服务商","正在申请服务器,选择云服务合作商"),
        icpEdiApply(2, "ICP/EDI申请中","正在协助企业完成ICP/EDI证书申请"),
        deployment(3, "服务器部署中","服务部署中,即将生成后台管理系统"),
        assessment(4, "系统安全等保评估","正在协助企业完成系统安全等保评估"),
        apiAccess(5, "API功能接入中","正在接入公共服务平台,开启数据共享支持"),
        goOnline(6, "应用商城上线","生成产品链接,协助企业完成APP商城上线");
        @EnumValue
        public Integer index;
        public String name;
        public String info;
        ProcessStatus(Integer index, String name,String info) {
            this.index = index;
            this.name = name;
            this.info = info;
        }
    }

    @Column(name = "plat_id")
    private String platId;
    @Column(name = "plat_name")
    private String platName;

    @Column(name = "process_status")
    private ProcessStatus processStatus;
    @Column(name = "process_step")
    private Integer processStep;

    @Column(name = "complete_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date completeTime;// 完成时间

    @Transient
    @TableField(exist = false)
    private List<Map<String,Object>> displayProcessList;


    public List<Map<String, Object>> getDisplayProcessList() {
        return displayProcessList;
    }

    public void setDisplayProcessList(List<Map<String, Object>> displayProcessList) {
        this.displayProcessList = displayProcessList;
    }

    public String getPlatId() {
        return platId;
    }

    public void setPlatId(String platId) {
        this.platId = platId;
    }

    public String getPlatName() {
        return platName;
    }

    public void setPlatName(String platName) {
        this.platName = platName;
    }

    public ProcessStatus getProcessStatus() {
        return processStatus;
    }

    public void setProcessStatus(ProcessStatus processStatus) {
        this.processStatus = processStatus;
    }

    public Integer getProcessStep() {
        return processStep;
    }

    public void setProcessStep(Integer processStep) {
        this.processStep = processStep;
    }

    public Date getCompleteTime() {
        return completeTime;
    }

    public void setCompleteTime(Date completeTime) {
        this.completeTime = completeTime;
    }
}
